# # 学生类
# class Students:
#
#     def __init__(self, sid, name, age, sex, height, weight, score, address, phone):
#         self.phone = phone
#         self.address = address
#         self.score = score
#         self.weight = weight
#         self.height = height
#         self.sex = sex
#         self.sid = sid
#         self.name = name
#         self.age = age
#     def studying(self,time):
#         print(time)
#
#     def game(self,gamename):
#         print(gamename)
#
#     def biancheng(self, hangshu):
#         print(hangshu)
#
#     def sum1(self, *num):
#         print(sum(num))
#
# stu = Students(20211221,'蔡徐坤',25,'男',"170cm",
#                "70kg","550分","中国",4008886666)
# stu.studying(20)
# stu.game('王者荣耀')
# stu.sum1(5,6,8,9,4,2,1)
# stu.biancheng(65)
# print(stu.name)
#
# # 车辆类
# class Car:
#     def __init__(self, ctype, num, color, weight, fuel):
#         self.fuel = fuel
#         self.weight = weight
#         self.color = color
#         self.num = num
#         self.ctype = ctype
#
#     def run(self, function):
#         print(function)
#
# car1 = Car('法拉利',4,'red','4t','50L')
# car2 = Car('宝马',4,'red','4t','50L')
# car3 = Car('铃木',4,'red','4t','50L')
# car4 = Car('五菱',4,'red','4t','50L')
# car5 = Car('拖拉机',4,'red','4t','50L')
#
#
# # 笔记本电脑类
# class NoteBook:
#     def __init__(self, ntype, time, color, weight, cputype, neicun, yingpan):
#         self.yingpan = yingpan
#         self.neicun = neicun
#         self.weight = weight
#         self.cputype = cputype
#         self.color = color
#         self.time = time
#         self.ntype = ntype
#
#     def playgame(self, name):
#         print(name)
#
#     def bangong(self):
#         print('正在办公')
#
#
# notebook = NoteBook('宏基', '2小时', '黑色', '1.5kg',
#                     'i7-10750H', '16G', '2.5TB')
#
#
# # 猴子类
# class Monkey:
#     def __init__(self, mtype, sex, color, weight):
#         self.mtype = mtype
#         self.sex = sex
#         self.color = color
#         self.weight = weight
#
#     def fire(cailiao):
#         print(f"造火的材料为：{cailiao}")
#
#
#     def studying(*study):
#         print(f"学习的事物有：{study}")
#
# monkey = Monkey('金丝猴', '雄', 'red', '30kg')
#
# print(monkey.mtype)
# monkey.studying('使用工具', '钻木取火')


class people:
    def __init__(self, name, sex, age, huafei, phbrond, dianchi, pingmu, phtime, jifen):
        self.jifen = jifen
        self.phtime = phtime
        self.pingmu = pingmu
        self.dianchi = dianchi
        self.phbrond = phbrond
        self.huafei = huafei
        self.age = age
        self.sex = sex
        self.name = name

    def faduanxin(self, content):
        print(f"短信内容：{content}")

    def callup(self, number, times):
        koufei = 0
        if number in '' or self.huafei < 1:
            print("手机号码不存在或剩余话费小于1元")
        else:
            if 0 < times <= 10:
                koufei = times * 1
                self.huafei -= koufei
                self.jifen += times * 15
            elif 10 < times <= 20:
                koufei = 10 + 0.8 * (times - 10)
                self.huafei = self.huafei - koufei
                self.jifen = self.jifen + 150 + 39 * (times - 10)
            else:
                koufei = 18 + 0.65 * (times -20)
                self.huafei = self.huafei - koufei
                self.jifen = self.jifen + 540 + 48 * (times -20)
        print(f"共扣费：{koufei}，剩余话费：{self.huafei}")
        print(f"当前积分：{self.jifen}")

tom = people("tom", '男', '24', 99,
             'vivo', '10000mAh', '4K',
             '2d', 0)

tom.faduanxin("你好杰瑞，我要给你打电话")
tom.callup("18864608573", 31)